import pickle

def isPrime(number,List):
    if number<List[-1]:
        if number in List:
            return True
        else:
            return False
    else:
        flag=0
        while List[flag]**2<=number:
            if number%List[flag]==0:
                return False
            flag+=1
        return True

F=open('primekid.txt','r')
l=pickle.load(F)
F.close()

primeNumber=0
diagonals=1
layer=1
step=2
radio=1
n=1

while radio>0.1:
    side=4
    diagonals+=side
    while side>0:
        n+=step
        if isPrime(n,l):
            primeNumber+=1
        side-=1
    step+=2
    layer+=2
    radio=primeNumber*1.0/diagonals
    print 'n',n,'layer',layer,'radio',radio
